home *** CD-ROM | disk | FTP | other *** search
/ Aminet 40 / Aminet 40 (2000)(Schatztruhe)[!][Dec 2000].iso / Aminet / util / cdity / ModeProSrc.lha / Prefs / MPNeuGadgets.c < prev    next >
C/C++ Source or Header  |  1998-12-24  |  64KB  |  1,279 lines

  1. #include "mppexterns.h"
  2. #include <extras/macros/intuition.h>
  3. #include <extras/layoutgt.h>
  4. #include <clib/extras_protos.h>
  5. #include <libraries/gadtools.h>
  6. #include <intuition/gadgetclass.h>
  7.  
  8. struct LG_Control *GadControl,*PGad2GadControl,*BackdropControl[3]={0};
  9. extern float XScale,YScale,PXScale,PYScale;
  10. struct Hook StrHook,PenLVHook,StrCursorHook,PromotionLVHook;
  11. extern UBYTE *CenterLabels[],*SFontLabels[],*OverscanLabels[],*ModeSelLabels[],*ListLabels[];
  12. extern struct TextFont *GUIFont;
  13. extern struct TextArea ColorDisp, PenNameDisp, FontDisp;
  14. extern struct Window *Win;
  15. extern struct MPMessage *ForcedEditMsg;
  16. extern struct TextAttr Topaz8;
  17.  
  18. #define UseString(x) x
  19.  
  20. WORD WindowWidth=620,WindowHeight=266;  
  21.  
  22. struct IBox GadgetArea[TOTAL_AREAS];
  23. struct List OptionList;
  24.  
  25. STRPTR G_PLIST, G_SELECT_NAME, G_NEW, G_REMOVE, G_ENTRIES, G_UK_NEW_ENTRY, G_UK_ENTRY_TYPE, G_PROMOTION, G_SELECT_SCREEN_MODE,
  26.        G_OVERSCAN, G_WIDTH, G_HEIGHT, G_COLORS, G_PALETTE, G_COLOR_SLIDER, G_EDIT_PALETTE, G_AUTOSCROLL, G_INTERLEAVE, G_BEHIND,
  27.        G_BLANK_BORDER, G_FORCE_PLANAR, G_CENTER, G_3D_LOOK, G_3D_DEFAULT, G_3D_RESET, G_FONT, G_FONT_SELECT, G_FONT_FIX_ASPECT,
  28.        G_SHARE_PENS, G_SP_EXCLUDE, G_MAKE_PUBLIC, G_PUB_NAME, G_DO_HOTKEY, G_HOTKEY, G_SAVE, G_USE, G_CANCEL, G_UK_USE_DELETE,
  29.        G_UK_USE,G_UK_NEVER_AGAIN, G_UK_CANCEL, G_BACKDROP, G_BACKDROPFILE,G_BACKDROPCENTER,G_BACKDROP_COLOR;
  30.  
  31. STRPTR BackdropLabels[]=
  32. {
  33.   (STRPTR)MSG_G_BACKDROP_OPT_NONE,
  34.   (STRPTR)MSG_G_BACKDROP_OPT_PICTURE,
  35.   (STRPTR)MSG_G_BACKDROP_OPT_COLOR,
  36.   0
  37. };
  38.  
  39. UBYTE BackdropColorTable;
  40.  
  41. STRPTR ForcedEditLabels[]=
  42. {
  43.   (STRPTR)MSG_G_SCREEN_NAMES,
  44.   (STRPTR)MSG_G_PROGRAM_NAMES,
  45.   (STRPTR)MSG_G_SCREEN_MODES,
  46.   0
  47. };
  48.  
  49. struct LG_Control *MakeMPPGadgets(struct Window *Window, APTR VisualInfo, struct TextAttr *TA)
  50. {
  51. //  WORD MaxPGadWidth;
  52.   
  53.   LONG l,ww,wh,feditspace;
  54.   float xs;
  55.  
  56.   
  57. //  char colorkeys[5],*colorstr;
  58.  
  59.   /*
  60.   struct IBox ibox[]={
  61.                         {7,    4,    194,   -25}, // list
  62.                         {212,  4,    232,    91}, // promm
  63.                         {212,  101,  232,  -179}, // opt
  64.                         {455,  4,    169,  -164}, // td
  65.                         {212,  -72,  232,    51}, // font
  66.                         {455,  -109,  169,   26}, // shrp **
  67.                         {455,  -77,  169,    25}, // pub  **
  68.                         {455,  -46,  169,    25}, // hotk **
  69.                         {455,  -154, 169,    38}, // backdrp **
  70.                         {7,    -15,  617,    12}  // pgad
  71.                      };
  72.  
  73.  
  74.   */
  75.   
  76.   
  77.   struct IBox ibox[]={
  78.                         {0,    0,    202,   -20}, // list
  79.                         {202,  0,    240,   100}, // promm
  80.                         {202,  100,  240,   -80}, // opt
  81.                         {442,  0,    178,  -168}, // td
  82.                         {202,  -80,  240,    60}, // font
  83.                         {442,  -122, 178,    34}, // shrp **
  84.                         {442,  -88,  178,    34}, // pub  **
  85.                         {442,  -54,  178,    34}, // hotk **
  86.                         {442,  -168, 178,    46}, // backdrp 46**
  87.                         {0,    -20,  620,    20}  // pgad
  88.                      };
  89.                      
  90.                      /*
  91.   struct IBox ibox[]={
  92.                         {8,    4,    194,   -28}, // list
  93.                         {212,  4,    232,    91}, // promm
  94.                         {212,  101,  232,  -179}, // opt
  95.                         {455,  4,    169,  -164}, // td
  96.                         {212,  -72,  232,    51}, // font
  97.                         {455,  -109,  169,   26}, // shrp **
  98.                         {455,  -77,  169,    26}, // pub  **
  99.                         {455,  -46,  169,    26}, // hotk **
  100.                         {455,  -154, 169,    38}, // backdrp **
  101.                         {8,    -20,  617,    12}  // pgad
  102.                      };
  103.   */
  104.  
  105. /*
  106.   if(GetWinInnerWidth(Window)  < WindowWidth  * PXScale ||
  107.      GetWinInnerHeight(Window) < WindowHeight * PYScale )
  108.   {
  109.     TA=&Topaz8;
  110.     XScale=1;
  111.     YScale=1;
  112.   }
  113.   else
  114.   {
  115.     XScale=PXScale;
  116.     YScale=PYScale;
  117.   }
  118.   */
  119.   
  120.   ww=((float)GetWinInnerWidth(Window)/XScale);
  121.   wh=((float)GetWinInnerHeight(Window)/YScale);
  122.   xs=(float)ww/(float)WindowWidth;
  123.  
  124. /*
  125.   colorstr=GetString(MSG_G_COLOR_SLIDER);
  126.  
  127.   colorkeys[0]=KeyUnshifted(colorstr[1]);
  128.   colorkeys[1]=KeyUnshifted(colorstr[0]);
  129.   colorkeys[2]=KeyShifted(colorstr[1]);
  130.   colorkeys[3]=KeyShifted(colorstr[0]);
  131.   colorkeys[4]=0;
  132.  
  133.   printf("%s - %s\n",colorstr,colorkeys);
  134. */
  135.   for(l=0;l<TOTAL_AREAS;l++)
  136.   {
  137.     GadgetArea[l].Left  =ibox[l].Left   *xs  + 4;
  138.     GadgetArea[l].Width =ibox[l].Width  *xs - 8;
  139.     
  140.     GadgetArea[l].Top=    (ibox[l].Top<0    ? ibox[l].Top   +=wh : ibox[l].Top) + 4;
  141.     GadgetArea[l].Height= (ibox[l].Height<0 ? ibox[l].Height+=wh-ibox[l].Top : ibox[l].Height) - 8; 
  142.   }
  143.  
  144.   feditspace=(GadgetArea[PGAD_AREA].Width-128)/3;
  145.  
  146.   if(GadControl=LG_CreateGadgets( /* init shit */
  147.                                 LG_VisualInfo           ,VisualInfo,
  148.                                 LG_UseWindowOffsets     ,Window,
  149.                                 LG_EraseRemoved         ,FALSE,
  150.                                 LG_TextAttr             ,TA,
  151.                                 LG_ScaleX               ,(ULONG)(XScale * 65535),
  152.                                 LG_ScaleY               ,(ULONG)(YScale * 65535),
  153.                                 /* List gadget offsets */
  154.                                 LG_Bounds               ,&GadgetArea[LIST_AREA],
  155.  
  156.                                 LG_SkipGadgets          ,(ForcedEditMsg ? 7 : 0),
  157.                                 /* List type */
  158.                                 LG_LeftEdge     ,0,
  159.                                 LG_TopEdge      ,0,
  160.                                 LG_Width        ,LG_REL_WIDTH(0),
  161.                                 LG_Height       ,12,
  162.                                 LG_GadgetText   ,/* UseString */(G_PLIST),
  163.                                 LG_GadgetID     ,GD_TYPE,
  164.                                 LG_Flags        ,PLACETEXT_LEFT,
  165.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  166.                                 LG_GadgetKind   ,CYCLE_KIND,
  167.                                 LG_GadgetTags   ,2,
  168.                                     GT_Underscore       ,'_',
  169.                                     GTCY_Labels         ,&ListLabels[0],
  170.                                 LG_CreateGadget  ,0,
  171.                                 
  172.                                 /* SELECT_NAME */
  173.                                 LG_TopEdge      ,LG_REL_BOTTOM(-12),
  174.                                 LG_GadgetText   ,/* UseString */(G_SELECT_NAME),
  175.                                 LG_GadgetID     ,GD_SELECT_NAME,
  176.                                 LG_Flags        ,PLACETEXT_IN,
  177.                                 LG_LabelFlags   ,0,
  178.                                 LG_GadgetKind   ,BUTTON_KIND,
  179.                                 LG_GadgetTags   ,1,
  180.                                     GT_Underscore       ,'_',
  181.                                 LG_CreateGadget  ,0,
  182.                                 
  183.                                 /* New */
  184.                                 LG_HorizCells     ,2,
  185.                                 LG_RelHorizGap    ,2,                                
  186.                                 
  187.                                 LG_LeftEdge     ,LG_REL_CELL_LEFTEDGE(0),
  188.                                 LG_TopEdge      ,LG_REL_BOTTOM(-25),
  189.                                 LG_Width        ,LG_REL_CELL_WIDTH(1),
  190.                                 LG_GadgetText   ,/* UseString */(G_NEW),
  191.                                 LG_GadgetID     ,GD_NEW,
  192.                                 LG_CreateGadget  ,0,
  193.                                 
  194.                                 /* Remove */
  195.                                 LG_LeftEdge     ,LG_REL_CELL_LEFTEDGE(1),
  196.                                 LG_GadgetText   ,/* UseString */(G_REMOVE),
  197.                                 LG_GadgetID     ,GD_REMOVE,
  198.                                 LG_CreateGadget  ,0,
  199.  
  200.  
  201.                                 /* Entry Name */
  202.                                 LG_LeftEdge     ,0,
  203.                                 LG_TopEdge      ,LG_REL_BOTTOM(-38),
  204.                                 LG_Width        ,LG_REL_WIDTH(-18),
  205.                                 LG_GadgetText   ,0,
  206.                                 LG_GadgetID     ,GD_NAME,
  207.                                 LG_GadgetKind   ,STRING_KIND,
  208.                                 LG_GadgetTags   ,2,
  209.                                     GTIN_EditHook       ,&StrCursorHook,
  210.                                     GTST_MaxChars       ,256,
  211.                                 LG_CreateGadget  , 0,
  212.  
  213.                                 /* List */
  214.                                 LG_TopEdge      ,29,
  215.                                 LG_Height       ,LG_REL_HEIGHT(-55),
  216.                                 LG_GadgetText   ,/* UseString */(G_ENTRIES),
  217.                                 LG_Flags        ,PLACETEXT_ABOVE,
  218.                                 LG_GadgetID     ,GD_LIST,
  219.                                 LG_GadgetKind   ,LISTVIEW_KIND,
  220.                                 LG_GadgetTags   ,5,
  221.                                     GT_Underscore       ,'_',
  222.                                     GTLV_ShowSelected   ,GD_NAME,
  223.                                     GTLV_ScrollWidth    ,(ULONG)(18 * XScale),
  224.                                     GTLV_CallBack       ,&PromotionLVHook,
  225.                                     LAYOUTA_Spacing     ,1,
  226.                                 LG_CreateGadget  ,0,
  227.  
  228.                                 /* Move */
  229.                                 LG_LeftEdge     ,LG_REL_RIGHT(-18),
  230.                                 LG_Width        ,18,
  231.                                 LG_GadgetID     ,GD_MOVE,
  232.                                 LG_GadgetKind   ,SLIDER_KIND,
  233.                                 LG_GadgetText   ,0,
  234.                                 LG_GadgetTags   ,5,
  235.                                     GT_Underscore       ,'_',
  236.                                     PGA_Freedom         ,LORIENT_VERT,
  237.                                     GTSL_Min            ,0, 
  238.                                     GTSL_Max            ,0, 
  239.                                     GTSL_Level          ,0,
  240.                                 LG_CreateGadget  ,0,
  241.                                 /* End of list gadgets */
  242.                                 
  243.                                 LG_SkipGadgets          ,(ForcedEditMsg ? 0 : 2),
  244.                                 
  245.                                 
  246.                                 
  247.                                 LG_LeftEdge     ,0,
  248.                                 LG_TopEdge      ,13,
  249.                                 LG_Width        ,LG_REL_WIDTH(0),
  250.                                 LG_Height       ,12,
  251.                                 LG_GadgetText   ,/* UseString */(G_UK_NEW_ENTRY),
  252.                                 LG_GadgetID     ,GD_FE_ENTRY_NAME,
  253.                                 LG_Flags        ,PLACETEXT_ABOVE,
  254.                                 LG_GadgetKind   ,TEXT_KIND,
  255.                                 LG_GadgetTags   ,3,
  256.                                   GTTX_Border           ,1,
  257.                                   GTTX_Justification    ,GTJ_CENTER,
  258.                                   GTTX_Clipped          ,1,
  259.                                 LG_CreateGadget  ,0,
  260.                                 
  261.                                 LG_TopEdge      ,39,
  262.                                 LG_GadgetText   ,/* UseString */(G_UK_ENTRY_TYPE),
  263.                                 LG_GadgetID     ,GD_FE_ENTRY_TYPE,
  264.                                 LG_CreateGadget  ,0,
  265.  
  266.                                 /* Promotion Gads */
  267.                                 LG_Bounds       ,&GadgetArea[PROM_AREA],
  268.                                 
  269.                                 /* ModeSel */
  270.                                 LG_LeftEdge     ,0,
  271.                                 LG_TopEdge      ,0,
  272.                                 LG_Width        ,LG_REL_WIDTH(0),
  273.                                 LG_Height       ,12,
  274.                                 LG_GadgetText   ,/* UseString */(G_PROMOTION),
  275.                                 LG_GadgetID     ,GD_MODESEL,
  276.                                 LG_Flags        ,PLACETEXT_LEFT,
  277.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  278.                                 LG_GadgetKind   ,CYCLE_KIND,
  279.                                 LG_GadgetTags   ,2,
  280.                                     GT_Underscore,'_',
  281.                                     GTCY_Labels, &ModeSelLabels[0], 
  282.                                 LG_CreateGadget  ,0,
  283.  
  284.                                 /* SelMode */
  285.                                 LG_TopEdge      ,13,
  286.                                 LG_GadgetText   ,/* UseString */(G_SELECT_SCREEN_MODE),
  287.                                 LG_GadgetID     ,GD_SELMODE,
  288.                                 LG_Flags        ,PLACETEXT_IN,
  289.                                 LG_LabelFlags   ,0,
  290.                                 LG_GadgetKind   ,BUTTON_KIND,
  291.                                 LG_GadgetTags   ,1,
  292.                                     GT_Underscore       ,'_',
  293.                                 LG_CreateGadget  ,0,
  294.  
  295.                                 /* Screen Mode */
  296.                                 LG_TopEdge      ,26,
  297.                                 LG_GadgetText   ,0,
  298.                                 LG_GadgetID     ,GD_SCREENMODE,
  299.                                 LG_GadgetKind   ,TEXT_KIND,
  300.                                 LG_GadgetTags   ,2,
  301.                                     GTTX_Border,                TRUE,
  302.                                     GTTX_Justification,         GTJ_CENTER,//                          (4.57.10)
  303.                                 LG_CreateGadget  ,0,
  304.                                 
  305.                                 /* DoOverscan */
  306.                                 /*
  307.                                 LG_LeftEdge     ,0,
  308.                                 LG_TopEdge      ,39,
  309.                                 LG_Width        ,26,
  310.                                 LG_Height       ,12,
  311.                                 LG_GadgetText   ,0,
  312.                                 LG_GadgetID     ,GD_DOOVERSCAN,
  313.                                 LG_Flags        ,PLACETEXT_RIGHT,
  314.                                 LG_LabelFlags   ,0,
  315.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  316.                                 LG_GadgetTags   ,2,
  317.                                     GT_Underscore       ,'_',
  318.                                     GTCB_Scaled , TRUE,
  319.                                 LG_CreateGadget ,0,
  320.                                 */
  321.                                 
  322.                                 /* Overscan */
  323.                                 /*
  324.                                 LG_LeftEdge     ,34,
  325.                                 LG_TopEdge      ,39,
  326.                                 LG_Width        ,LG_REL_WIDTH(-34),
  327.                                 */
  328.                                 LG_LeftEdge     ,0,
  329.                                 LG_TopEdge      ,39,
  330.                                 LG_Width        ,LG_REL_WIDTH(0),
  331.                                 
  332.                                 LG_GadgetText   ,/* UseString */(G_OVERSCAN),
  333.                                 LG_GadgetID     ,GD_OVERSCAN,
  334.                                 LG_Flags        ,PLACETEXT_LEFT,
  335.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  336.                                 LG_GadgetKind   ,CYCLE_KIND,
  337.                                 LG_GadgetTags   ,2,
  338.                                     GT_Underscore       ,'_',
  339.                                     GTCY_Labels, &OverscanLabels[0],
  340.                                 LG_CreateGadget  ,0,
  341.                                
  342.                                
  343.                                 LG_HorizCells   ,2,
  344.                                 LG_RelHorizGap  ,8,                                
  345.                                 
  346.                                 
  347.                                 /* Width */
  348.                                 LG_TopEdge      ,52,
  349.                                 LG_Width        ,LG_REL_CELL_WIDTH(1),
  350. //                                LG_Width        ,GadgetArea[PROM_AREA].Width/2-8,
  351.                                 LG_GadgetText   ,/* UseString */(G_WIDTH),
  352.                                 LG_GadgetID     ,GD_WIDTH,
  353.                                 LG_GadgetKind   ,INTEGER_KIND,
  354.                                 LG_GadgetTags   ,2,
  355.                                     GT_Underscore       ,'_',
  356.                                     GTIN_MaxChars, 10,
  357.                                 LG_CreateGadget  ,0,
  358.  
  359.                                 /* Height */
  360.                                 //LG_LeftEdge     ,GadgetArea[PROM_AREA].Width/2+8,
  361.                                 LG_LeftEdge     ,LG_REL_CELL_LEFTEDGE(1),
  362.                                 LG_GadgetText   ,/* UseString */(G_HEIGHT),
  363.                                 LG_GadgetID     ,GD_HEIGHT,
  364.                                 LG_GadgetTags   ,2,
  365.                                     GT_Underscore       ,'_',
  366.                                     GTIN_MaxChars, 10,
  367.                                 LG_CreateGadget  ,0,
  368.                                 
  369.                                 /* Do Depth */
  370.                                 LG_LeftEdge     ,0,
  371.                                 LG_TopEdge      ,66,
  372.                                 LG_Width        ,26,
  373.                                 LG_Height       ,12,
  374.                                 LG_GadgetText   ,/* UseString */(G_COLORS),
  375.                                 LG_GadgetID     ,GD_DODEPTH,
  376.                                 LG_Flags        ,PLACETEXT_RIGHT,
  377.                                 LG_LabelFlags   ,0,
  378.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  379.                                 LG_GadgetTags   ,2,
  380.                                     GT_Underscore       ,'_',
  381.                                     GTCB_Scaled , TRUE,
  382.                                 LG_CreateGadget ,0,
  383.                                 
  384.                                 /* Palette */
  385.                                 LG_TopEdge      ,79,
  386.                                 LG_GadgetText   ,/* UseString */(G_PALETTE),
  387.                                 LG_GadgetID     ,GD_PALETTE,
  388.                                 LG_CreateGadget ,0,
  389.                                 
  390.                                 /* Palette II */
  391.                                 /*
  392.                                 LG_TopEdge      ,79,
  393.                                 LG_GadgetText   ,"Palette:",
  394.                                 LG_GadgetID     ,100,
  395.                                 LG_GadgetKind   ,CYCLE_KIND,
  396.                                 LG_Flags        ,PLACETEXT_LEFT,
  397.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  398.                                 LG_Width        ,116,
  399.                                 LG_Height       ,12,
  400.                                 LG_GadgetTags   ,2,
  401.                                     GT_Underscore       ,'_',
  402.                                     GTCY_Labels         ,plabels,
  403.                                 LG_CreateGadget ,0,
  404.                                 */
  405.                                 
  406.                                 /* Colors */
  407.                                 LG_LeftEdge     ,LG_REL_RIGHT(0),
  408.                                 LG_TopEdge      ,66,
  409.                                 LG_Width        ,LG_REL_WIDTH(-163),
  410.                                 LG_GadgetText   ,/* UseString */(G_COLOR_SLIDER),
  411.                                 LG_GadgetID     ,GD_DEPTH,
  412.                                 LG_Flags        ,PLACETEXT_RIGHT,
  413.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  414.                                 LG_Justification,LG_JUST_RIGHT | LG_JUST_WITHLABEL,
  415.                                 LG_GadgetKind   ,SLIDER_KIND,
  416.                                 LG_KeyString    ,/* UseString */(G_COLOR_SLIDER),
  417.                                 LG_GadgetTags   ,4,
  418.                                     GT_Underscore       ,'_',
  419.                                     PGA_Freedom         ,LORIENT_HORIZ,
  420.                                     GTSL_Min            ,1,
  421.                                     GTSL_Max            ,8,
  422.                                 LG_CreateGadget  ,0,
  423.                                 
  424.                                 /* Edit Pal */
  425.                                 LG_TopEdge      ,79,
  426.                                 LG_Width        ,LG_REL_WIDTH(-117),
  427.                                 LG_GadgetText   ,/* UseString */(G_EDIT_PALETTE),
  428.                                 LG_GadgetID     ,GD_EDITPALETTE,
  429.                                 LG_Flags        ,PLACETEXT_IN,
  430.                                 LG_GadgetKind   ,BUTTON_KIND,
  431.                                 LG_GadgetTags   ,1,
  432.                                     GT_Underscore       ,'_',
  433.                                 LG_CreateGadget ,0,
  434.  
  435.                                 LG_Justification,0,
  436.  
  437.                                 /* Option Gads */
  438.                                 LG_Bounds       ,&GadgetArea[OPT_AREA],
  439.  
  440.                                 /* AutoScroll*/
  441.                                 LG_LeftEdge     ,0,
  442.                                 LG_TopEdge      ,0,
  443.                                 LG_Width        ,26,
  444.                                 LG_Height       ,12,
  445.                                 LG_GadgetText   ,/* UseString */(G_AUTOSCROLL),
  446.                                 LG_GadgetID     ,GD_AUTOSCROLL,
  447.                                 LG_Flags        ,PLACETEXT_RIGHT,
  448.                                 LG_LabelFlags   ,0,
  449.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  450.                                 LG_GadgetTags   ,2,
  451.                                     GT_Underscore       ,'_',
  452.                                     GTCB_Scaled, TRUE,
  453.                                 LG_CreateGadget  ,0,
  454.                                 
  455.                                 /* Interleave */
  456.                                 LG_TopEdge      ,13,
  457.                                 //LG_LeftEdge     ,GadgetArea[OPT_AREA].Width/2,
  458.                                 LG_GadgetText   ,/* UseString */(G_INTERLEAVE),
  459.                                 LG_GadgetID     ,GD_INTERLEAVE,
  460.                                 LG_CreateGadget  ,0,
  461.                                 
  462.                                 /* Behind */
  463.                                 LG_TopEdge      ,26,
  464.                                 //LG_LeftEdge     ,GadgetArea[OPT_AREA].Width/2,
  465.                                 LG_GadgetText   ,/* UseString */(G_BEHIND),
  466.                                 LG_GadgetID     ,GD_BEHIND,
  467.                                 
  468.                                 LG_CreateGadget ,0,
  469.                                 
  470.                                 /* Open Blank */
  471.                                 LG_TopEdge      ,39,
  472.                                 //LG_LeftEdge     ,0,
  473.                                 LG_GadgetText   ,/* UseString */(G_BLANK_BORDER),
  474.                                 LG_GadgetID     ,GD_BLANK_BORDER,
  475.                                 LG_CreateGadget ,0,
  476.                             
  477.                                 /* Force Planar */
  478.                                 LG_TopEdge      ,52,
  479.                                 LG_GadgetText   ,/* UseString */(G_FORCE_PLANAR),
  480.                                 LG_GadgetID     ,GD_FORCE_PLANAR,
  481.                                 LG_CreateGadget  ,0,
  482.  
  483.                                 /* Center */
  484.                                 LG_LeftEdge     ,0,
  485.                                 LG_TopEdge      ,65,
  486.                                 LG_Width        ,LG_REL_WIDTH(0),
  487.                                 LG_GadgetText   ,/* UseString */(G_CENTER),
  488.                                 LG_GadgetID     ,GD_CENTER,
  489.                                 LG_Flags        ,PLACETEXT_LEFT,
  490.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  491.                                 LG_GadgetKind   ,CYCLE_KIND,
  492.                                 LG_GadgetTags   ,2,
  493.                                     GT_Underscore       ,'_',
  494.                                     GTCY_Labels         ,&CenterLabels[0],
  495.                                 LG_CreateGadget  ,0,
  496.                                 /*
  497.                                 /* Options List*/
  498.                                 LG_TopEdge      ,0,
  499.                                 LG_Height       ,LG_REL_HEIGHT(-13),
  500.                                 LG_GadgetText   ,"_Options (T-oggle)",
  501.                                 LG_GadgetID     ,GD_AUTOSCROLL,
  502.                                 LG_Flags        ,PLACETEXT_ABOVE,
  503.                                 LG_GadgetKind   ,LISTVIEW_KIND,
  504.                                 LG_GadgetTags   ,3,
  505.                                   GTLV_ShowSelected     ,0,
  506.                                   GT_Underscore         ,'_',
  507.                                   GTLV_Labels           ,&OptionList,
  508.                                 LG_CreateGadget ,0,
  509.                                 */
  510.                                 /* End Opt */
  511.                                 /* Begin 3d */
  512.                                 LG_Bounds       ,&GadgetArea[TD_AREA],
  513.                                 
  514.                                 /* LOOK3D */
  515.                                 LG_LeftEdge     ,0,
  516.                                 LG_TopEdge      ,0,
  517.                                 LG_Width        ,26,
  518.                                 LG_Height       ,12,
  519.                                 LG_GadgetText   ,/* UseString */(G_3D_LOOK),
  520.                                 LG_GadgetID     ,GD_LOOK3D,
  521.                                 LG_Flags        ,PLACETEXT_RIGHT,
  522.                                 LG_LabelFlags   ,0,
  523.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  524.                                 LG_GadgetTags   ,2,
  525.                                     GT_Underscore       ,'_',
  526.                                     GTCB_Scaled         ,TRUE,
  527.                                 LG_CreateGadget  ,0,
  528.                                 
  529.                                 LG_TopEdge      ,13,
  530.                                 LG_GadgetText   ,/* UseString */(G_3D_DEFAULT),
  531.                                 LG_GadgetID     ,GD_3D_DEFAULT,
  532.                                 LG_CreateGadget  ,0,
  533.                                 
  534.                                 /* Reset Pens */
  535.                                 LG_TopEdge      ,26,
  536.                                 LG_Width        ,LG_REL_WIDTH(0),
  537.                                 LG_GadgetText   ,/* UseString */(G_3D_RESET),
  538.                                 LG_GadgetID     ,GD_RESETPENS,
  539.                                 LG_Flags        ,PLACETEXT_IN,
  540.                                 LG_GadgetKind   ,BUTTON_KIND,
  541.                                 LG_GadgetTags   ,1,
  542.                                     GT_Underscore       ,'_',
  543.                                 LG_CreateGadget  ,0,
  544.                                 
  545.                                 
  546.                                 /* PenList */
  547.                                 LG_TopEdge      ,39,
  548.                                 LG_Height       ,LG_REL_HEIGHT(-52),
  549.                                 LG_GadgetText   ,0,
  550.                                 LG_GadgetID     ,GD_PENLIST,
  551.                                 LG_GadgetKind   ,LISTVIEW_KIND,
  552.                                 LG_GadgetTags   ,3,
  553.                                     GT_Underscore       ,'_',
  554.                                     GTLV_CallBack       ,&PenLVHook,
  555.                                     GTLV_ScrollWidth    ,18,
  556.                                 LG_CreateGadget  ,0,
  557.                                 
  558.                                 /* PenVal */
  559.                                 LG_LeftEdge     ,LG_REL_RIGHT(-55),
  560.                                 LG_TopEdge      ,LG_REL_BOTTOM(-13),
  561.                                 LG_Width        ,55,
  562.                                 LG_Height       ,12,
  563.                                 LG_GadgetID     ,GD_PENVAL,
  564.                                 LG_GadgetKind   ,INTEGER_KIND,
  565.                                 LG_GadgetTags   ,2,
  566.                                     GT_Underscore       ,'_',
  567.                                     GTIN_EditHook       ,&StrCursorHook,
  568.                                 LG_CreateGadget  ,0,
  569.  
  570.                                 /* Font */
  571.                                 LG_Bounds       ,&GadgetArea[FONT_AREA],
  572.                                 
  573.                                 /* Font Mode */
  574.                                 LG_LeftEdge     ,0,
  575.                                 LG_TopEdge      ,0,
  576.                                 LG_Width        ,LG_REL_WIDTH(0),
  577.                                 LG_Height       ,12,
  578.                                 LG_GadgetText   ,/* UseString */(G_FONT),
  579.                                 LG_GadgetID     ,GD_SFONT,
  580.                                 LG_Flags        ,PLACETEXT_LEFT,
  581.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  582.                                 LG_GadgetKind   ,CYCLE_KIND,
  583.                                 LG_GadgetTags   ,2,
  584.                                     GT_Underscore       ,'_',
  585.                                     GTCY_Labels         ,&SFontLabels[0],
  586.                                 LG_CreateGadget  ,0,
  587.  
  588.                                 /* Pick font */
  589.                                 LG_TopEdge      ,13,
  590.                                 LG_GadgetText   ,/* UseString */(G_FONT_SELECT),
  591.                                 LG_GadgetID     ,GD_PICKFONT,
  592.                                 LG_Flags        ,PLACETEXT_IN,
  593.                                 LG_LabelFlags   ,0,
  594.                                 LG_GadgetKind   ,BUTTON_KIND,
  595.                                 LG_GadgetTags   ,1,
  596.                                     GT_Underscore       ,'_',
  597.                                 LG_CreateGadget  ,0,
  598.                                 
  599.                                 /* Fix Aspect */
  600.                                 LG_TopEdge      ,39,
  601.                                 LG_Width        ,26,
  602.                                 LG_GadgetText   ,/* UseString */(G_FONT_FIX_ASPECT),
  603.                                 LG_GadgetID     ,GD_FASPECT,
  604.                                 LG_Flags        ,PLACETEXT_RIGHT,
  605.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  606.                                 LG_GadgetTags   ,2,
  607.                                     GT_Underscore       ,'_',
  608.                                     GTCB_Scaled         ,TRUE,
  609.                                 LG_CreateGadget  ,0,
  610.                                 /* End font */
  611.                                 /* Begin Share pens */
  612.                                 LG_Bounds      ,&GadgetArea[SHPN_AREA],
  613.                                 
  614.                                 /* Share Pens */
  615.                                 LG_LeftEdge     ,0,
  616.                                 LG_TopEdge      ,0,
  617.                                 LG_Width        ,26,
  618.                                 LG_Height       ,12,
  619.                                 LG_GadgetText   ,/* UseString */(G_SHARE_PENS),
  620.                                 LG_GadgetID     ,GD_SHAREPENS,
  621.                                 LG_Flags        ,PLACETEXT_RIGHT,
  622.                                 LG_LabelFlags   ,0,
  623.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  624.                                 LG_GadgetTags   ,2,
  625.                                     GT_Underscore       ,'_',
  626.                                     GTCB_Scaled         ,TRUE,
  627.                                 LG_CreateGadget  ,0,
  628.                                 
  629.                                 /* Exclude */
  630.                                 LG_TopEdge      ,14,
  631.                                 LG_Width        ,LG_REL_WIDTH(0),
  632.                                 LG_GadgetText   ,/* UseString */(G_SP_EXCLUDE),
  633.                                 LG_GadgetID     ,GD_LOCKEDPENS,
  634.                                 LG_Flags        ,PLACETEXT_LEFT,
  635.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  636.                                 LG_GadgetKind   ,STRING_KIND,
  637.                                 LG_GadgetTags   ,3,
  638.                                     GT_Underscore       ,'_',
  639.                                     GTST_EditHook       ,&StrHook,
  640.                                     GTST_MaxChars       ,256,
  641.                                 LG_CreateGadget  ,0,
  642.                                 /* End share */
  643.                                 /* Begin Public */
  644.                                 LG_Bounds       ,&GadgetArea[PUB_AREA],
  645.                                 
  646.                                 /* Make Public */
  647.                                 LG_LeftEdge     ,0,
  648.                                 LG_TopEdge      ,0,
  649.                                 LG_Width        ,26,
  650.                                 LG_Height       ,12,
  651.                                 LG_GadgetText   ,/* UseString */(G_MAKE_PUBLIC),
  652.                                 LG_GadgetID     ,GD_PUBOPT,
  653.                                 LG_Flags        ,PLACETEXT_RIGHT,
  654.                                 LG_LabelFlags   ,0,
  655.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  656.                                 LG_GadgetTags   ,2,
  657.                                     GT_Underscore       ,'_',
  658.                                     GTCB_Scaled         ,TRUE,
  659.                                 LG_CreateGadget  ,0,
  660.                                 
  661.                                 /* Pub Name */
  662.                                 LG_TopEdge      ,13,
  663.                                 LG_Width        ,LG_REL_WIDTH(0),
  664.                                 LG_GadgetText   ,/* UseString */(G_PUB_NAME),
  665.                                 LG_GadgetID     ,GD_PUBNAME,
  666.                                 LG_Flags        ,PLACETEXT_LEFT,
  667.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  668.                                 LG_GadgetKind   ,STRING_KIND,
  669.                                 LG_GadgetTags   ,1,
  670.                                     GT_Underscore       ,'_',
  671.                                     GTST_MaxChars       ,MAXPUBSCREENNAME+1,
  672.                                 LG_CreateGadget  ,0,
  673.                                 /* End Pub */
  674.                                 /* Begin HotKey */
  675.                                 LG_Bounds       ,&GadgetArea[HOTK_AREA],
  676.                                 /* Do HotKey */
  677.                                 LG_LeftEdge     ,0,
  678.                                 LG_TopEdge      ,0,
  679.                                 LG_Width        ,26,
  680.                                 LG_Height       ,12,
  681.                                 LG_GadgetText   ,/* UseString */(G_DO_HOTKEY),
  682.                                 LG_GadgetID     ,GD_HOTKEYOPT,
  683.                                 LG_Flags        ,PLACETEXT_RIGHT,
  684.                                 LG_LabelFlags   ,0,
  685.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  686.                                 LG_GadgetTags   ,2,
  687.                                     GT_Underscore       ,'_',
  688.                                     GTCB_Scaled         ,TRUE,
  689.                                 LG_CreateGadget  ,0,
  690.                                 
  691.                                 /* HotKey Str */
  692.                                 LG_TopEdge      ,13,
  693.                                 LG_Width        ,LG_REL_WIDTH(0),
  694.                                 LG_GadgetText   ,/* UseString */(G_HOTKEY),
  695.                                 LG_GadgetID     ,GD_HOTKEYSTR,
  696.                                 LG_Flags        ,PLACETEXT_LEFT,
  697.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  698.                                 LG_GadgetKind   ,STRING_KIND,
  699.                                 LG_GadgetTags   ,1,
  700.                                     GT_Underscore       ,'_',
  701.                                 LG_CreateGadget  ,0,
  702.                                 /* End HK */
  703.                                 
  704.                                 /* Begin Backdrop */
  705.                                 LG_Bounds       ,&GadgetArea[BACKDROP_AREA],
  706.                                 /*/* Do BD */
  707.                                 LG_LeftEdge     ,0,
  708.                                 LG_TopEdge      ,0,
  709.                                 LG_Width        ,26,
  710.                                 LG_Height       ,12,
  711.                                 LG_GadgetText   ,(G_BACKDROP),
  712.                                 LG_GadgetID     ,GD_BACKDROPOPT,
  713.                                 LG_Flags        ,PLACETEXT_RIGHT,
  714.                                 LG_LabelFlags   ,0,
  715.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  716.                                 LG_GadgetTags   ,2,
  717.                                     GT_Underscore       ,'_',
  718.                                     GTCB_Scaled         ,TRUE,
  719.                                 LG_CreateGadget  ,0,*/
  720.  
  721.                                 /* Do BD */
  722.                                 LG_LeftEdge     ,0,
  723.                                 LG_TopEdge      ,0,
  724.                                 LG_Width        ,LG_REL_WIDTH(0),
  725.                                 LG_Height       ,12,
  726.                                 LG_GadgetText   ,(G_BACKDROP),
  727.                                 LG_GadgetID     ,GD_BACKDROPOPT,
  728.                                 LG_Flags        ,PLACETEXT_LEFT,
  729.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  730.                                 LG_GadgetKind   ,CYCLE_KIND,
  731.                                 LG_GadgetTags   ,2,
  732.                                     GT_Underscore       ,'_',
  733.                                     GTCY_Labels         ,BackdropLabels,
  734.                                 LG_CreateGadget  ,0,
  735.                                 /*
  736.                                 /* Backdrop File */
  737.                                 LG_TopEdge      ,13,
  738.                                 LG_Width        ,50,
  739.                                 LG_GadgetText   ,(G_BACKDROPFILE),
  740.                                 LG_GadgetID     ,GD_BACKDROPPICK,
  741.                                 LG_Flags        ,PLACETEXT_IN,
  742.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  743.                                 LG_GadgetKind   ,BUTTON_KIND,
  744.                                 LG_GadgetTags   ,1,
  745.                                     GT_Underscore       ,'_',
  746.                                 LG_CreateGadget  ,0,
  747.                                 
  748.                                 LG_TopEdge      ,26,
  749.                                 LG_Width        ,26,
  750.                                 LG_GadgetText   ,(G_BACKDROPCENTER),
  751.                                 LG_GadgetID     ,GD_BACKDROPCENTER,
  752.                                 LG_Flags        ,PLACETEXT_RIGHT,
  753.                                 LG_LabelFlags   ,0,
  754.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  755.                                 LG_GadgetTags   ,2,
  756.                                     GT_Underscore       ,'_',
  757.                                     GTCB_Scaled         ,TRUE,
  758.                                 LG_CreateGadget  ,0,
  759.                                 
  760.                                 /* Backdrop Filename */
  761.                                 LG_TopEdge      ,13,
  762.                                 LG_LeftEdge     ,51,
  763.                                 LG_Width        ,LG_REL_WIDTH(-51),
  764.                               LG_GadgetText   ,0,
  765.                                 LG_GadgetID     ,GD_BACKDROPFILENAME,
  766.                                 LG_GadgetKind   ,TEXT_KIND,
  767.                                 LG_GadgetTags   ,2,
  768.                                   GTTX_Border           ,1,
  769.                                   GTTX_Clipped          ,1,
  770.                                 LG_CreateGadget ,0,
  771.                                 /* End BD */                                
  772.                                 */
  773.                                 
  774.                                 /* Begin SUC */
  775.                                 LG_Bounds       ,&GadgetArea[PGAD_AREA],
  776.                                 
  777.                                 LG_SkipGadgets ,(ForcedEditMsg?3:0),
  778.                                 
  779.                                 /* Save */
  780.                                 LG_LeftEdge     ,0,
  781.                                 LG_TopEdge      ,0,
  782.                                 LG_Width        ,87,
  783.                                 LG_Height       ,12,
  784.                                 LG_GadgetText   ,/* UseString */(G_SAVE),
  785.                                 LG_GadgetID     ,GD_SAVE,
  786.                                 LG_Flags        ,PLACETEXT_IN,
  787.                                 LG_LabelFlags   ,0,
  788.                                 LG_GadgetKind   ,BUTTON_KIND,
  789.                                 LG_CreateGadget  ,0,
  790.                                 
  791.                                 /* Use */
  792.                                 LG_LeftEdge     ,GadgetArea[PGAD_AREA].Width/2,
  793.                                 LG_GadgetText   ,/* UseString */(G_USE),
  794.                                 LG_GadgetID     ,GD_USE,
  795.                                 LG_Justification,LG_JUST_HCENTER,
  796.                                 LG_CreateGadget  ,0,
  797.                                 
  798.                                 /* Cancel */
  799.                                 LG_LeftEdge     ,LG_REL_RIGHT(-87),
  800.                                 LG_GadgetText   ,/* UseString */(G_CANCEL),
  801.                                 LG_GadgetID     ,GD_CANCEL,
  802.                                 LG_Justification,LG_JUST_LEFT,
  803.                                 LG_CreateGadget  ,0,
  804.                                 
  805.                                 LG_SkipGadgets ,(ForcedEditMsg?0:4),
  806.                                 
  807.                                 /* */
  808.                                 LG_Justification,LG_JUST_LEFT,
  809.                                 LG_LeftEdge     ,0,
  810.                                 LG_TopEdge      ,0,
  811.                                 LG_Width        ,128,
  812.                                 LG_Height       ,12,
  813.                                 LG_GadgetText   ,/* UseString */(G_UK_USE),
  814.                                 LG_GadgetID     ,GD_FE_SAVEUSE,
  815.                                 LG_Flags        ,PLACETEXT_IN,
  816.                                 LG_LabelFlags   ,0,
  817.                                 LG_GadgetKind   ,BUTTON_KIND,
  818.                                 LG_CreateGadget  ,0,
  819.                                 
  820.                                 /* Use */
  821.                                 LG_LeftEdge      ,feditspace * 1,
  822.                                 LG_GadgetText    ,/* UseString */(G_UK_USE_DELETE),
  823.                                 LG_GadgetID      ,GD_FE_USEDELETE,
  824.                                 LG_CreateGadget  ,0,
  825.                                 
  826.                                 /* Cancel */
  827.                                 LG_LeftEdge      ,feditspace * 2,
  828.                                 LG_GadgetText    ,/* UseString */(G_UK_NEVER_AGAIN),
  829.                                 LG_GadgetID      ,GD_FE_NEVER,
  830.                                 LG_CreateGadget  ,0,
  831.                                 
  832.                                 /* Cancel */
  833.                                 LG_LeftEdge      ,feditspace * 3,
  834.                                 LG_GadgetText    ,/* UseString */(G_UK_CANCEL),
  835.                                 LG_GadgetID      ,GD_FE_CANCEL,
  836.                                 LG_CreateGadget  ,0,
  837.                                 
  838.                                 
  839.                                 TAG_DONE))
  840.   {
  841.     if(BackdropControl[1]=LG_CreateGadgets(
  842.                                 LG_VisualInfo           ,VisualInfo,
  843.                                 LG_UseWindowOffsets     ,Window,
  844.                                 LG_EraseRemoved         ,TRUE,
  845.                                 LG_TextAttr             ,TA,
  846.                                 LG_ScaleX               ,(ULONG)(XScale * 65535),
  847.                                 LG_ScaleY               ,(ULONG)(YScale * 65535),
  848.                                 
  849.                                 LG_Bounds       ,&GadgetArea[BACKDROP_AREA],
  850.                                 
  851.                                 LG_LeftEdge     ,0,
  852.                                 LG_Height       ,12,
  853.                                 
  854.                                 /* Backdrop File */
  855.                                 LG_TopEdge      ,13,
  856.                                 LG_Width        ,50,
  857.                                 LG_GadgetText   ,(G_BACKDROPFILE),
  858.                                 LG_GadgetID     ,GD_BACKDROPPICK,
  859.                                 LG_Flags        ,PLACETEXT_IN,
  860.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  861.                                 LG_GadgetKind   ,BUTTON_KIND,
  862.                                 LG_GadgetTags   ,1,
  863.                                     GT_Underscore       ,'_',
  864.                                 LG_CreateGadget  ,0,
  865.                                 
  866.                                 LG_TopEdge      ,26,
  867.                                 LG_Width        ,26,
  868.                                 LG_GadgetText   ,(G_BACKDROPCENTER),
  869.                                 LG_GadgetID     ,GD_BACKDROPCENTER,
  870.                                 LG_Flags        ,PLACETEXT_RIGHT,
  871.                                 LG_LabelFlags   ,0,
  872.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  873.                                 LG_GadgetTags   ,2,
  874.                                     GT_Underscore       ,'_',
  875.                                     GTCB_Scaled         ,TRUE,
  876.                                 LG_CreateGadget  ,0,
  877.                                 
  878.                                 /* Backdrop Filename */
  879.                                 LG_TopEdge      ,13,
  880.                                 LG_LeftEdge     ,51,
  881.                                 LG_Width        ,LG_REL_WIDTH(-51),
  882.                                 LG_GadgetText   ,0,
  883.                                 LG_GadgetID     ,GD_BACKDROPFILENAME,
  884.                                 LG_GadgetKind   ,TEXT_KIND,
  885.                                 LG_GadgetTags   ,2,
  886.                                   GTTX_Border           ,1,
  887.                                   GTTX_Clipped          ,1,
  888.                                 LG_CreateGadget ,0,
  889.                                 
  890.                                 TAG_DONE))
  891.     {
  892.       LG_AddLGControl(GadControl,BackdropControl[1]);
  893.       //printf("BackdropControl[1]\n");
  894.       BackdropColorTable=BackdropPen;
  895.       
  896.       if(BackdropControl[2]=LG_CreateGadgets(
  897.                                 LG_VisualInfo           ,VisualInfo,
  898.                                 LG_UseWindowOffsets     ,Window,
  899.                                 LG_EraseRemoved         ,TRUE,
  900.                                 LG_TextAttr             ,TA,
  901.                                 LG_ScaleX               ,(ULONG)(XScale * 65535),
  902.                                 LG_ScaleY               ,(ULONG)(YScale * 65535),
  903.                                 
  904.                                 LG_Bounds       ,&GadgetArea[BACKDROP_AREA],
  905.                                 
  906.                                 LG_LeftEdge     ,0,
  907.                                 LG_Height       ,26,
  908.                                 
  909.                                 /* Backdrop File */
  910.                                 LG_TopEdge      ,13,
  911.                                 LG_Width        ,LG_REL_WIDTH(0),
  912.                                 LG_GadgetText   ,G_BACKDROP_COLOR,
  913.                                 LG_GadgetID     ,GD_BACKDROPCOLOR,
  914.                                 LG_Flags        ,PLACETEXT_ABOVE,
  915.                                 LG_LabelFlags   ,LGLF_FITLABEL,
  916.                                 LG_GadgetKind   ,PALETTE_KIND,
  917.                                 LG_GadgetTags   ,3,
  918.                                     GT_Underscore,      '_',
  919.                                     GTPA_NumColors,     1,
  920.                                     GTPA_ColorTable,    &BackdropColorTable,
  921.                                 LG_CreateGadget  ,0,
  922.                                 
  923.                                 TAG_DONE))
  924.       {
  925.         LG_AddLGControl(GadControl,BackdropControl[2]);
  926.         
  927.         
  928.         //printf("BackdropControl[2]\n");
  929.       }
  930.     }
  931.   }
  932.  
  933.  
  934.  
  935.   ColorDisp.LeftEdge  =GadgetArea[PROM_AREA].Left+106;
  936.   ColorDisp.TopEdge   =GadgetArea[PROM_AREA].Top+66;
  937.   ColorDisp.Width     =49;
  938.   ColorDisp.Height    =12;
  939.  
  940.   PenNameDisp.LeftEdge  =GadgetArea[TD_AREA].Left;
  941.   PenNameDisp.TopEdge   =GadgetArea[TD_AREA].Top+GadgetArea[TD_AREA].Height-13;
  942.   PenNameDisp.Width     =GadgetArea[TD_AREA].Width-61;
  943.   PenNameDisp.Height    =12;
  944.  
  945.   FontDisp.LeftEdge  =GadgetArea[FONT_AREA].Left;
  946.   FontDisp.TopEdge   =GadgetArea[FONT_AREA].Top+26;
  947.   FontDisp.Width     =GadgetArea[FONT_AREA].Width;
  948.   FontDisp.Height    =12;
  949.  
  950.   SetupTextArea(&ColorDisp);
  951.   SetupTextArea(&PenNameDisp);
  952.   SetupTextArea(&FontDisp);
  953.  
  954.   return(GadControl);
  955. }
  956.  
  957. void FreeMPPGadgets(void)
  958. {
  959.   LG_FreeGadgets(GadControl);
  960.   GadControl=0;
  961.   BackdropControl[1]=0;
  962.   BackdropControl[2]=0;  
  963. }
  964.  
  965. void SetupTextArea(struct TextArea *TA)
  966. {
  967.   TA->LeftEdge   = TA->LeftEdge * XScale+Win->BorderLeft;
  968.   TA->Width      *= XScale;
  969.   TA->TopEdge    = TA->TopEdge  * YScale+Win->BorderTop;
  970.   TA->Height     *= YScale;
  971.   TA->RightEdge   = TA->Width  + TA->LeftEdge;
  972.   TA->BottomEdge  = TA->Height + TA->TopEdge;
  973.  
  974.   TA->Baseline=(TA->BottomEdge - TA->TopEdge - GUIFont->tf_YSize)/2 
  975.                       + GUIFont->tf_Baseline + TA->TopEdge;
  976. }
  977.  
  978.  
  979. BOOL GadgetInit(void)
  980. {
  981.   G_PLIST           = GetString(MSG_G_PLIST);
  982.   G_SELECT_NAME     = GetString(MSG_G_SELECT_NAME);
  983.   G_NEW             = GetString(MSG_G_NEW);
  984.   G_REMOVE          = GetString(MSG_G_REMOVE);
  985.   G_ENTRIES         = GetString(MSG_G_ENTRIES);
  986.   G_UK_NEW_ENTRY    = GetString(MSG_G_UK_NEW_ENTRY);
  987.   G_UK_ENTRY_TYPE   = GetString(MSG_G_UK_ENTRY_TYPE);
  988.   G_PROMOTION       = GetString(MSG_G_PROMOTION);
  989.   G_SELECT_SCREEN_MODE = GetString(MSG_G_SELECT_SCREEN_MODE);
  990.   G_OVERSCAN        = GetString(MSG_G_OVERSCAN);
  991.   G_WIDTH           = GetString(MSG_G_WIDTH);
  992.   G_HEIGHT          = GetString(MSG_G_HEIGHT);
  993.   G_COLORS          = GetString(MSG_G_COLORS);
  994.   G_PALETTE         = GetString(MSG_G_PALETTE);
  995.   G_COLOR_SLIDER    = GetString(MSG_G_COLOR_SLIDER);
  996.   G_EDIT_PALETTE    = GetString(MSG_G_EDIT_PALETTE);
  997.   G_AUTOSCROLL      = GetString(MSG_G_AUTOSCROLL);
  998.   G_INTERLEAVE      = GetString(MSG_G_INTERLEAVE);
  999.   G_BEHIND          = GetString(MSG_G_BEHIND);
  1000.   G_BLANK_BORDER    = GetString(MSG_G_BLANK_BORDER);
  1001.   G_FORCE_PLANAR    = GetString(MSG_G_FORCE_PLANAR);
  1002.   G_CENTER          = GetString(MSG_G_CENTER);
  1003.   G_3D_LOOK         = GetString(MSG_G_3D_LOOK);
  1004.   G_3D_DEFAULT      = GetString(MSG_G_3D_DEFAULT);
  1005.   G_3D_RESET        = GetString(MSG_G_3D_RESET);
  1006.   G_FONT            = GetString(MSG_G_FONT);
  1007.   G_FONT_SELECT     = GetString(MSG_G_FONT_SELECT);
  1008.   G_FONT_FIX_ASPECT = GetString(MSG_G_FONT_FIX_ASPECT);
  1009.   G_SHARE_PENS      = GetString(MSG_G_SHARE_PENS);
  1010.   G_SP_EXCLUDE      = GetString(MSG_G_SP_EXCLUDE);
  1011.   G_MAKE_PUBLIC     = GetString(MSG_G_MAKE_PUBLIC);
  1012.   G_PUB_NAME        = GetString(MSG_G_PUB_NAME);
  1013.   G_DO_HOTKEY       = GetString(MSG_G_DO_HOTKEY);
  1014.   G_HOTKEY          = GetString(MSG_G_HOTKEY);
  1015.   G_SAVE            = GetString(MSG_G_SAVE);
  1016.   G_USE             = GetString(MSG_G_USE);
  1017.   G_CANCEL          = GetString(MSG_G_CANCEL);
  1018.   G_UK_USE_DELETE   = GetString(MSG_G_UK_USE_DELETE);
  1019.   G_UK_USE          = GetString(MSG_G_UK_USE);
  1020.   G_UK_NEVER_AGAIN  = GetString(MSG_G_UK_NEVER_AGAIN);
  1021.   G_UK_CANCEL       = GetString(MSG_G_UK_CANCEL);
  1022.   G_BACKDROP        = GetString(MSG_G_BACKDROP);
  1023.   G_BACKDROPFILE    = GetString(MSG_G_BACKDROPFILE);
  1024.   G_BACKDROPCENTER  = GetString(MSG_G_BACKDROPCENTER);
  1025.   G_BACKDROP_COLOR  = GetString(MSG_G_BACKDROP_COLOR);
  1026.  
  1027.   /*
  1028.   struct Node *n;
  1029.   STRPTR optname;
  1030.   ULONG l;
  1031.  
  1032.   struct OItem
  1033.   {
  1034.     ULONG NameID;
  1035.     BYTE FlagBit;
  1036.   } oi[]=
  1037.     {
  1038.     { MSG_G_AUTOSCROLL),    2},
  1039.     { MSG_G_BLANK_BORDER),  3},
  1040.     { MSG_G_BEHIND),              4},
  1041.     { MSG_G_FORCE_PLANAR,   5},
  1042.     { MSG_G_INTERLEAVE,     6},
  1043.     { -1,-1}
  1044.     };
  1045.  
  1046.   NewList(&OptionList);
  1047.   
  1048.   for(l=0;oi[l].NameID!=-1;l++)
  1049.   {
  1050.     if(n=AllocVec(sizeof(struct Node),MEMF_PUBLIC))
  1051.     {
  1052.       optname=/* UseString */(oi[l].NameID);
  1053.       if(n->ln_Name=AllocVec(strlen(optname)+2,MEMF_PUBLIC))
  1054.       {
  1055.         n->ln_Name[0]=' ';
  1056.         n->ln_Pri=oi[l].FlagBit;
  1057.         strcpy(&n->ln_Name[1],optname);
  1058.         EnqueueName(&OptionList,n);
  1059.       }
  1060.       else
  1061.       {
  1062.         FreeVec(n);
  1063.       }
  1064.     }
  1065.   }
  1066.   */
  1067.   return(1);
  1068. }
  1069.  
  1070. void GadgetCleanup(void)
  1071. {
  1072.   /*
  1073.   struct Node *n;
  1074.   
  1075.   while(n=RemHead(&OptionList))
  1076.   {
  1077.     FreeVec(n->ln_Name);
  1078.     FreeVec(n);
  1079.   }
  1080.   */
  1081. }
  1082.  
  1083. /*
  1084.  
  1085.         if(ForcedControl=LG_CreateGadgets( /* init shit */
  1086.                                 LG_VisualInfo           ,VisualInfo,
  1087.                                 LG_UseWindowOffsets     ,Window,
  1088.                                 LG_EraseRemoved         ,FALSE,
  1089.                                 LG_TextAttr             ,TA,
  1090.                                 LG_ScaleX               ,(ULONG)(XScale * 65535),
  1091.                                 LG_ScaleY               ,(ULONG)(YScale * 65535),
  1092.                                 /* List gadget offsets */
  1093.                                 LG_Bounds               ,&GadgetArea[LIST_AREA],
  1094.  
  1095.                                 LG_LeftEdge     ,0,
  1096.                                 LG_TopEdge      ,12,
  1097.                                 LG_Width        ,LG_REL_WIDTH(0),
  1098.                                 LG_Height       ,12,
  1099.                                 LG_GadgetText   ,GetString(MSG_G_UK_NEW_ENTRY),
  1100.                                 LG_GadgetID     ,GD_FE_ENTRY_NAME,
  1101.                                 LG_Flags        ,PLACETEXT_ABOVE,
  1102.                                 LG_GadgetKind   ,TEXT_KIND,
  1103.                                 LG_GadgetTags   ,3,
  1104.                                   GTTX_Border           ,1,
  1105.                                   GTTX_Justification    ,GTJ_CENTER,
  1106.                                   GTTX_Clipped          ,1,
  1107.                                 LG_CreateGadget  ,0,
  1108.  
  1109.                                 /* ScreenName Check Box */
  1110.                                 LG_TopEdge      ,25,
  1111.                                 LG_Width        ,26,
  1112.                                 LG_Height       ,12,
  1113.                                 LG_GadgetText   ,GetString(MSG_G_SCREEN_NAMES),
  1114.                                 LG_GadgetID     ,GD_FE_USE_SCREENNAME,
  1115.                                 LG_Flags        ,PLACETEXT_RIGHT,
  1116.                                 LG_LabelFlags   ,0,
  1117.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  1118.                                 LG_GadgetTags   ,2,
  1119.                                     GT_Underscore       ,'_',
  1120.                                     GTCB_Scaled         ,TRUE,
  1121.                                 LG_CreateGadget  ,0,
  1122.                                 
  1123.                                 /* Screen Name Display */
  1124.                                 LG_TopEdge      ,38,
  1125.                                 LG_GadgetText   ,0,
  1126.                                 LG_GadgetID     ,GD_FE_SCREENNAME_DISP,
  1127.                                 LG_GadgetKind   ,TEXT_KIND,
  1128.                                 LG_GadgetTags   ,3,
  1129.                                   GTTX_Border           ,1,
  1130.                                   GTTX_Justification    ,GTJ_LEFT,
  1131.                                   GTTX_Clipped          ,1,
  1132.                                 LG_CreateGadget  ,0,
  1133.                                 
  1134.                                 /* ProgName Check Box */
  1135.                                 LG_TopEdge      ,51,
  1136.                                 LG_Width        ,26,
  1137.                                 LG_Height       ,12,
  1138.                                 LG_GadgetText   ,GetString(MSG_G_PROGRAM_NAMES),
  1139.                                 LG_GadgetID     ,GD_FE_USE_PROGRAMNAME,
  1140.                                 LG_Flags        ,PLACETEXT_RIGHT,
  1141.                                 LG_LabelFlags   ,0,
  1142.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  1143.                                 LG_GadgetTags   ,2,
  1144.                                     GT_Underscore       ,'_',
  1145.                                     GTCB_Scaled         ,TRUE,
  1146.                                 LG_CreateGadget  ,0,
  1147.                                 
  1148.                                 /* Screen Name Display */
  1149.                                 LG_TopEdge      ,64,
  1150.                                 LG_GadgetText   ,0,
  1151.                                 LG_GadgetID     ,GD_FE_PROGRAMNAME_DISP,
  1152.                                 LG_GadgetKind   ,TEXT_KIND,
  1153.                                 LG_GadgetTags   ,3,
  1154.                                   GTTX_Border           ,1,
  1155.                                   GTTX_Justification    ,GTJ_LEFT,
  1156.                                   GTTX_Clipped          ,1,
  1157.                                 LG_CreateGadget  ,0,
  1158.  
  1159.                                 /* ScreenMode Check Box */
  1160.                                 LG_TopEdge      ,77,
  1161.                                 LG_Width        ,26,
  1162.                                 LG_Height       ,12,
  1163.                                 LG_GadgetText   ,GetString(MSG_G_SCREEN_MODES),
  1164.                                 LG_GadgetID     ,GD_FE_USE_SCREENMODE,
  1165.                                 LG_Flags        ,PLACETEXT_RIGHT,
  1166.                                 LG_LabelFlags   ,0,
  1167.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  1168.                                 LG_GadgetTags   ,2,
  1169.                                     GT_Underscore       ,'_',
  1170.                                     GTCB_Scaled         ,TRUE,
  1171.                                 LG_CreateGadget  ,0,
  1172.                                 
  1173.                                 /* Screen Name Display */
  1174.                                 LG_TopEdge      ,90,
  1175.                                 LG_GadgetText   ,0,
  1176.                                 LG_GadgetID     ,GD_FE_SCREENMODE_DISP,
  1177.                                 LG_GadgetKind   ,TEXT_KIND,
  1178.                                 LG_GadgetTags   ,3,
  1179.                                   GTTX_Border           ,1,
  1180.                                   GTTX_Justification    ,GTJ_LEFT,
  1181.                                   GTTX_Clipped          ,1,
  1182.                                 LG_CreateGadget  ,0,
  1183. */
  1184.  
  1185.  
  1186. /*
  1187.                                 LG_LeftEdge     ,0,
  1188.                                 LG_TopEdge      ,12,
  1189.                                 LG_Width        ,LG_REL_WIDTH(0),
  1190.                                 LG_Height       ,12,
  1191.                                 LG_GadgetText   ,GetString(MSG_G_UK_NEW_ENTRY),
  1192.                                 LG_GadgetID     ,GD_FE_ENTRY_NAME,
  1193.                                 LG_Flags        ,PLACETEXT_ABOVE,
  1194.                                 LG_GadgetKind   ,TEXT_KIND,
  1195.                                 LG_GadgetTags   ,3,
  1196.                                   GTTX_Border           ,1,
  1197.                                   GTTX_Justification    ,GTJ_CENTER,
  1198.                                   GTTX_Clipped          ,1,
  1199.                                 LG_CreateGadget  ,0,
  1200.  
  1201.                                 /* ScreenName Check Box */
  1202.                                 LG_TopEdge      ,25,
  1203.                                 LG_Width        ,26,
  1204.                                 LG_Height       ,12,
  1205.                                 LG_GadgetText   ,GetString(MSG_G_SCREEN_NAMES),
  1206.                                 LG_GadgetID     ,GD_FE_SCREENNAME,
  1207.                                 LG_Flags        ,PLACETEXT_RIGHT,
  1208.                                 LG_LabelFlags   ,0,
  1209.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  1210.                                 LG_GadgetTags   ,2,
  1211.                                     GT_Underscore       ,'_',
  1212.                                     GTCB_Scaled         ,TRUE,
  1213.                                 LG_CreateGadget  ,0,
  1214.                                 
  1215.                                 /* Screen Name Display */
  1216.                                 LG_TopEdge      ,38,
  1217.                                 LG_Width        ,LG_REL_WIDTH(0),
  1218.                                 LG_GadgetText   ,0,
  1219.                                 LG_GadgetID     ,GD_FE_SCREENNAME_DISP,
  1220.                                 LG_GadgetKind   ,TEXT_KIND,
  1221.                                 LG_GadgetTags   ,3,
  1222.                                   GTTX_Border           ,1,
  1223.                                   GTTX_Justification    ,GTJ_LEFT,
  1224.                                   GTTX_Clipped          ,1,
  1225.                                 LG_CreateGadget  ,0,
  1226.                                 
  1227.                                 /* ProgName Check Box */
  1228.                                 LG_TopEdge      ,51,
  1229.                                 LG_Width        ,26,
  1230.                                 LG_Height       ,12,
  1231.                                 LG_GadgetText   ,GetString(MSG_G_PROGRAM_NAMES),
  1232.                                 LG_GadgetID     ,GD_FE_PROGRAMNAME,
  1233.                                 LG_Flags        ,PLACETEXT_RIGHT,
  1234.                                 LG_LabelFlags   ,0,
  1235.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  1236.                                 LG_GadgetTags   ,2,
  1237.                                     GT_Underscore       ,'_',
  1238.                                     GTCB_Scaled         ,TRUE,
  1239.                                 LG_CreateGadget  ,0,
  1240.                                 
  1241.                                 /* ProgName Display */
  1242.                                 LG_TopEdge      ,64,
  1243.                                 LG_Width        ,LG_REL_WIDTH(0),
  1244.                                 LG_GadgetText   ,0,
  1245.                                 LG_GadgetID     ,GD_FE_PROGRAMNAME_DISP,
  1246.                                 LG_GadgetKind   ,TEXT_KIND,
  1247.                                 LG_GadgetTags   ,3,
  1248.                                   GTTX_Border           ,1,
  1249.                                   GTTX_Justification    ,GTJ_LEFT,
  1250.                                   GTTX_Clipped          ,1,
  1251.                                 LG_CreateGadget  ,0,
  1252.  
  1253.                                 /* ScreenMode Check Box */
  1254.                                 LG_TopEdge      ,77,
  1255.                                 LG_Width        ,26,
  1256.                                 LG_Height       ,12,
  1257.                                 LG_GadgetText   ,GetString(MSG_G_SCREEN_MODES),
  1258.                                 LG_GadgetID     ,GD_FE_SCREENMODE,
  1259.                                 LG_Flags        ,PLACETEXT_RIGHT,
  1260.                                 LG_LabelFlags   ,0,
  1261.                                 LG_GadgetKind   ,CHECKBOX_KIND,
  1262.                                 LG_GadgetTags   ,2,
  1263.                                     GT_Underscore       ,'_',
  1264.                                     GTCB_Scaled         ,TRUE,
  1265.                                 LG_CreateGadget  ,0,
  1266.                                 
  1267.                                 /* Screen Mode Display */
  1268.                                 LG_TopEdge      ,90,
  1269.                                 LG_Width        ,LG_REL_WIDTH(0),
  1270.                                 LG_GadgetText   ,0,
  1271.                                 LG_GadgetID     ,GD_FE_SCREENMODE_DISP,
  1272.                                 LG_GadgetKind   ,TEXT_KIND,
  1273.                                 LG_GadgetTags   ,3,
  1274.                                   GTTX_Border           ,1,
  1275.                                   GTTX_Justification    ,GTJ_LEFT,
  1276.                                   GTTX_Clipped          ,1,
  1277.                                 LG_CreateGadget  ,0,
  1278.                                 */
  1279.